<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/common.css" type="text/css" />
<script language="javascript" src="js/jquery-1.4.2.min.js"></script>
<script language="javascript" src="js/jquery.checkboxes.min.js"></script>
<script language="javascript" src="js/tableRowCheckboxToggle.js"></script>
<script>
$(document).ready(function(){
		//点击事件切换 全选取消状态
		$("#selectall").click( function (){ $("#grouplist").toggleCheckboxes(); });
	});
</script>

<title>列表</title>
</head>

<body>
<div id="man_zone">
<?php if($action=="edit"){?>
<form action="?action=edit" method="post" enctype="multipart/form-data">
<input name="gid" type="hidden" id="gid" value="<?php echo $gid;?>" />
<table width="99%" border="0" align="center"  cellpadding="3" cellspacing="1" class="table_style">
    <tr>
      <td width="15%" align="right" class="left_title_1">配送ID：</td>
      <td width="85%"><input name="did" type="text" id="did" value="<?php echo $value['did']?>"  readonly="true"/></td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">配送名：</td>
      <td><input name="name" type="text" id="name" value="<?php echo $value['name']?>"/></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td align="right" class="left_title_2">首重重量：</td>
      <td><input name="first_weight" type="text" id="first_weight" value="<?php echo $value['first_weight']?>"   /> Kg</td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">续重重量：</td>
      <td><input name="continue_weight" type="text" id="continue_weight" value="<?php echo $value['continue_weight']?>"> Kg</td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">首重费用：</td>
      <td>$ <input name="first_fee" type="text" id="first_fee" value="<?php echo $value['first_fee']?>"></td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">续重费用：</td>
      <td>$ <input name="continue_fee" type="text" id="continue_fee" value="<?php echo $value['continue_fee']?>" /></td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">描述：</td>
      <td><textarea name="about" cols="50" rows="5" id="about"><?php echo $value['about']?></textarea></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td align="right" class="left_title_2">&nbsp;</td>
      <td><input type="submit" name="Submit" value="提交" />
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="reset" name="Submit2" value="重置" /></td>
    </tr>
  </table>

  </form>
  
   <?php }elseif($action=="add"){?>
  
  <form action="?action=add" method="post" enctype="multipart/form-data">
<input name="gid" type="hidden" id="gid" value="<?php echo $gid;?>" />
<table width="99%" border="0" align="center"  cellpadding="3" cellspacing="1" class="table_style">

  <tr>
    <td align="right" class="left_title_2">配送名：</td>
    <td><input name="name" type="text" id="name" /></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td align="right" class="left_title_2">首重重量：</td>
    <td><input name="first_weight" type="text" id="first_weight"> Kg</td>
  </tr>
  <tr>
    <td align="right" class="left_title_2">续重重量：</td>
    <td><input name="continue_weight" type="text" id="continue_weight" /> Kg</td>
  </tr>
  <tr>
    <td align="right" class="left_title_2">首重费用：</td> 
    <td>$ <input name="first_fee" type="text" id="first_fee" /></td>
  </tr>
  <tr>
    <td align="right" class="left_title_2">续重费用：</td>
    <td>$ <input name="continue_fee" type="text" id="continue_fee" /></td>
  </tr>
  <tr>
    <td align="right" class="left_title_2">描述：</td>
    <td><textarea name="textarea" cols="50" rows="5" id="textarea"><?php echo $value['about']?></textarea></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td align="right" class="left_title_2">&nbsp;</td>
    <td><input type="submit" name="Submitadd" value="提交" />
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <input type="reset" name="Submit22" value="重置" /></td>
  </tr>
</table>
  </form>
  
  <?php }elseif(empty($action)){?>
  
  <table width="99%" border="0" align="center" cellpadding="0" cellspacing="1">
    <tr>
      <td width="37%">
	    
    <input type="button" onclick="grouplist.submit();" name="Submit" value="删除选定" />
    <input type="button" onclick="location.href='?action=add'" name="Submit4" value="添加配送" /></td>
      <td width="63%" align="right"><form id="seach" name="seach" method="get" action="">
         &nbsp;配送名称：
            <input name="name" type="text" id="name" size="15" />
          &nbsp;
            <input type="submit" name="Submit3" value="搜索" />
      </form>
      </td>
    </tr>
  </table>
<form method="post" action="?action=dels" name="grouplist" id="grouplist">
  <table width="99%" align="center"  border="0" cellpadding="3" cellspacing="1" class="table_style">
    <tr>
      <th width="2%"><label>
        <input type="checkbox" name="checkbox" value="checkbox" id="selectall" />
      </label></th>
      <th width="5%">ID</th>
      <th width="15%">配送名称</th>
      <th width="15%">首重重量</th>
      <th width="12%">续重重量</th>
      <th width="13%">首重价格</th>
      <th width="7%">续重价格</th>
      <th>描述</th>
      <th width="12%">操作</th>
    </tr>
	<?php if(is_array($dataarray)){foreach($dataarray as $value){?>
    <tr class="odd_row">
      <td align="center"><input type="checkbox" name="delids[]" value="<?php echo $value['did']?>" /></td>
      <td><?php echo $value['did']?></td>
      <td><?php echo $value['name']?></td>
      <td><?php echo $value['first_weight']?> KG</td>
      <td><?php echo $value['continue_weight']?> KG</td>
      <td>$ <?php echo $value['first_fee']?>&nbsp;&nbsp;</td>
      <td>$ <?php echo $value['continue_fee']?></td>
      <td><?php echo $value['about']?></td>
      <td>
<a href="pay_delivery.php?action=edit&amp;did=<?php echo $value['did']?>">编辑配送 </a>|<a href="javascript:if(confirm('确实要删除吗?'))location='pay_delivery.php?action=del&did=<?php echo $value['did']?>'"> 删除</a></td>
    </tr>
	<?php }}else{?>
	<tr><td colspan=9>暂无数据..............</td></tr>
	<?php };?>
  </table>
  

  <div style="width:99%;margin:0px auto;">

  
    <?php echo multi($total,$pagesize,$page,"");?>
  </div>
  </form>
  <?php }?>
</div>
</body>
</html>
